package rule;

//替换ribbon核心的irule下默认的轮询算法
//不能建立在Main下,package包扫描使所有的客户端共享,达不到定制化的效果

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyIRule {

    @Bean
    public IRule myRule() {
        return new RandomRule();//将分配服务的算法定义为随机
    }

}
